﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using Abp.Domain.Entities.Auditing;
using System.ComponentModel.DataAnnotations.Schema;
using Sunlit.Business.Authorization.Users;

namespace Sunlit.Business.Commerces
{
    [Table("AbpCommerceMessages")]
    public class CommerceMessage: CreationAuditedEntity<long>
    {
        /// <summary>
        /// 留言联系人
        /// </summary>
        [StringLength(32)]
        public string LinkMan { get; set; }
        /// <summary>
        /// 留言人电话
        /// </summary>
        [StringLength(32)]
        public string PhoneNumber { get; set; }
        /// <summary>
        /// 留言内容
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 留言文章ID
        /// </summary>
        public long CommerceId { get; set; }
        [ForeignKey(nameof(CommerceId))]
        public virtual Commerce Commerce { get; set; }
        /// <summary>
        /// 留言接收者ID
        /// </summary>
        public long? ReceiverId { get; set; }
        [ForeignKey(nameof(ReceiverId))]
        public virtual User Receiver { get; set; }

    }
}
